

function initConsole()
	
	consoleMaxLines = 100
	consoleDisplayLines = 4

	consoleValues = {}
	for i=1,consoleMaxLines,1 do
		consoleValues[i] = {}
		consoleValues[i].text = ""
		consoleValues[i].colour = "white"
	end

	consoleValues[1].text = "He's dead. It's over. Time to get out of here."
end

function addConsoleMessage(message, colour)

	if (colour == nil) then colour = "white" end

	for i=consoleMaxLines,2,-1 do
		consoleValues[i].text = consoleValues[i-1].text
		consoleValues[i].colour = consoleValues[i-1].colour
	end

	consoleValues[1].text = message
	consoleValues[1].colour = colour
end

function drawConsole(xbase, ybase)

	love.graphics.setColor(255,255,255,255)
	love.graphics.quad("line", xbase, ybase, xbase+750, ybase+0, xbase+750, ybase+70, xbase+0, ybase+70)

	local colVal = 0

	local indx = consoleDisplayLines
	for i=1,consoleDisplayLines,1 do
		colVal = colVal - 40

		if (consoleValues[i].colour == "white") then
			love.graphics.setColor(255+colVal,255+colVal,255+colVal,255)
		elseif (consoleValues[i].colour == "red") then
			love.graphics.setColor(255+colVal,0,0,255)
		elseif (consoleValues[i].colour == "yellow") then
			love.graphics.setColor(255+colVal,255+colVal,0,255)
		elseif (consoleValues[i].colour == "green") then
			love.graphics.setColor(0,255+colVal,0,255)
		end

		love.graphics.print( consoleValues[i].text , xbase+5,ybase+2  + 16*(indx-1))
		indx = indx - 1
	end

	love.graphics.setColor(255,255,255,255)

end

function drawBigConsole()

	love.graphics.setColor(0,0,0,200)

	local xbase = 100
	local ybase = 95

	local xsize = 600
	local ysize = 410

	love.graphics.quad("fill", xbase, ybase, xbase+xsize, ybase+0, xbase+xsize, ybase+ysize, xbase+0, ybase+ysize)

	love.graphics.setColor(255,255,255,255)
	love.graphics.quad("line", xbase, ybase, xbase+xsize, ybase+0, xbase+xsize, ybase+ysize, xbase+0, ybase+ysize)
	love.graphics.setColor(255,255,0,255)

	love.graphics.setColor(255,255,255,255)

	local ybase = 100

	local colVal = 0

	local indx = 25
	for i=1,25,1 do
		colVal = colVal - 5

		if (consoleValues[i].colour == "white") then
			love.graphics.setColor(255+colVal,255+colVal,255+colVal,255)
		elseif (consoleValues[i].colour == "red") then
			love.graphics.setColor(255+colVal,0,0,255)
		elseif (consoleValues[i].colour == "yellow") then
			love.graphics.setColor(255+colVal,255+colVal,0,255)
		elseif (consoleValues[i].colour == "green") then
			love.graphics.setColor(0,255+colVal,0,255)
		end

		love.graphics.print( consoleValues[i].text , xbase+5,ybase+2  + 16*(indx-1))
		indx = indx - 1
	end


	love.graphics.setColor(0,0,0,200)
	love.graphics.quad("fill", xbase, ybase - 35, xbase + 280, ybase - 35, xbase + 280, ybase - 10, xbase, ybase-10)

	love.graphics.setColor(255,255,255,255)
	love.graphics.quad("line", xbase, ybase - 35, xbase + 280, ybase - 35, xbase + 280, ybase - 10, xbase, ybase-10)

	love.graphics.setColor(255,255,0,255)
	love.graphics.print("HISTORY - PRESS ESC/C TO RETURN", xbase+10, ybase - 30)

	love.graphics.setColor(255,255,255,255)


end
